const articleMapper = require('@/mappers/articleMapper');

async function articleCreate(payload) {
    const result = await articleMapper.articleCreate(payload);
    return result
}


async function articleQuery(payload) {
    const page = parseInt(payload.page, 10) || 1;
    const pageSize = parseInt(payload.pageSize, 10) || 10;
    const result = await articleMapper.articleQuery({ page, pageSize });
    return result
}


async function articleUpdate(payload) {
    const result = await articleMapper.articleUpdate(payload);
    return result
}


async function articleDelete(payload) {
    const result = await articleMapper.articleDelete( payload );
    return result
}

module.exports = { 
    articleCreate,
    articleQuery,
    articleUpdate,
    articleDelete
};